import { createApp } from 'vue'
import App from './App.vue'
import dsButton from './components/Global/ds-button.vue'
const app = createApp(App)
import './assets/css/reset.css'

// https://vuejs.org/api/application.html
// app.provide('key',value)
// Provide a value that can be injected in all descendent components within the application.
const globalValue = '全局注入'
app.provide('globalValue', globalValue)

// app.component('string',component)
// Registers a global component for other component uses
app.component('ds-button', dsButton)
// app.directive()  
// Registers a global custom directive for other component uses
app.directive('color', (el: HTMLElement, binding) => {
  el.style.color = 'skyblue'
})
// app.config.globalProperties !!!
app.config.globalProperties.msg = 'hello'
// 在运行模块增加声明 msg ,以致于所有组件可使用全局属性或函数
declare module '@vue/runtime-core' {
  export interface ComponentCustomProperties {
    msg: string
  }
}

app.mount('#app')
